Function Switch-Node
{
    [CmdletBinding()]
    Param(
        [Parameter(Mandatory = $True)]
        [System.Xml.XmlDocument]
        $private:XmlDocument,
        
        [Parameter(Mandatory = $True)]
        [System.Xml.XmlNode]
        $private:OldNode,
        
        [Parameter(Mandatory = $True)]
        [System.Xml.XmlNode]
        $private:NewNode
    )
    
    Process
    {
        $private:NewNode = $XmlDocument.ImportNode($NewNode, $True)
        $XmlDocument.ReplaceChild($NewNode, $OldNode)
    }
}

Export-ModuleMember Switch-Node
